let count = 0
const showLoading = () => {
  if (count === 0) {
    const loadingDiv = document.getElementById('loading')
    loadingDiv?.style.setProperty('display', 'flex')
  }
  count++
}

const hideLoading = () => {
  count--
  if (count > 0) return
  const loadingDiv = document.getElementById('loading')
  loadingDiv?.style.setProperty('display', 'none')
}

export { showLoading, hideLoading }
